﻿using System.Collections.Generic;
using System.Linq;
using Model.Database;
using SearchModel;
using System.Web;

namespace IBll//此处最好为IBll，这样和IBll下的同名类进行合并而扩展
{
    public partial interface IUserInfoBll
    {
        /// <summary>
        /// 根据用户名和密码查询UserInfo
        /// </summary>
        UserInfo GetUserInfoByUsernamePassword(string username, string password);
        /// <summary>
        /// 条件分页查询
        /// </summary>
        /// <returns></returns>
        List<UserInfo> GetListBySearchPage(int pageIndex,int pageSize,out int total, SMUserInfo smUserInfo);
        /// <summary>
        /// 批量删除
        /// </summary>
        void ListDelete(string[] idArr);
        /// <summary>
        /// 获取角色
        /// </summary>
        List<Role> GetRole(string id);
        /// <summary>
        /// 批量禁用
        /// </summary>
        void ListForbidden(string[] idArr);
        /// <summary>
        /// 批量解禁
        /// </summary>
        void ListNoForbidden(string[] idArr);
        /// <summary>
        /// 增加用户和UserInfo_Role关系表,UserInfo_Department关系表
        /// </summary>
        bool AddUserInfoAndUserInfo_Role_Department(UserInfo userInfo);
        /// <summary>
        /// 更新用户和UserInfo_Role关系表,UserInfo_Department关系表
        /// </summary>
        bool UpdateUserInfoAndUserInfo_Role_Department(UserInfo userInfo);
        /// <summary>
        /// 获取部门
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        List<Department> GetDepartment(string id);
        /// <summary>
        /// 更新头像
        /// </summary>
        /// <param name="file"></param>
        /// <param name="loginUser"></param>
        void UpdateHeadPhoto(HttpPostedFileBase file, UserInfo loginUser);
    }
}
